<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>7.2.JS数组-获取数组-数组长度</title>
    <script>
        // 数组的长度 数组名.length
        var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
        for (var i = 0; i < arr.length; i++) {
            console.log(arr[i]);
        }
        // 1.数组的长度是元素个数 不要跟索引号混淆
        // 2.数组名.length 动态监测数组元素的个数
    </script>
</head>

<body>

</body>

</html>